/* CLASS 覆盖 **************************************************************** */
// 使 RangePicker 的 input 无样式，需要配合 :bordered="false" 使用
.ant-cover__RangePicker-input-no-style,
.ant-picker-range.ant-picker-borderless.ant-cover__RangePicker-input-no-style {
  padding: 0;
  border: none;

  .ant-picker-input > input {
    border-radius: 0;
    line-height: 2.2em;
  }

  .ant-picker-input:first-of-type input {
    text-align: right;
  }

  &.ant-picker-focused .ant-picker-input.ant-picker-input-active input {
    &,
    &::placeholder {
      text-decoration: underline 1px;
      text-underline-offset: 2px;
    }
  }

  .ant-picker-active-bar {
    display: none;
  }

  .ant-picker-suffix {
    display: none;
  }

  .ant-picker-clear {
    background: transparent;
    right: 8px;
  }
}

.ant-picker-range.ant-picker-borderless.ant-cover__RangePicker-3d-gray {
  @extend .ant-cover__RangePicker-input-no-style;

  background-color: #3e404c !important;
  border-radius: 8px;
  box-shadow: 0 3.3px 0 0 #363742 !important;
  margin-bottom: 3.3px;
  padding: 4px;

  &.ant-picker-disabled {
    opacity: 0.6;
  }

  .ant-picker-input > input {
    line-height: 32px;
  }
}

/* 全局覆盖 ***************************************************************** */
@media bp-lt-tabletl {
  // 禁用所有动画
  .ant-picker-dropdown,
  .ant-picker-dropdown * {
    transition: none !important;
    animation: none !important;
  }

  // 日期+时间选择器
  .ant-picker-datetime-panel {
    display: block !important;

    .ant-picker-time-panel {
      border: none !important;

      .ant-picker-header {
        border-top: 1px solid rgba(253, 253, 253, 0.12);
      }

      .ant-picker-header-view:empty {
        display: none !important;
      }

      .ant-picker-content {
        height: 90px !important;
      }

      .ant-picker-time-panel-cell-inner {
        margin: 0 auto;
        width: 100% !important;
        padding: 0 !important;
        text-align: center;
      }

      .ant-picker-time-panel-column::after {
        display: none;
      }
    }
  }

  // 日期选择器
  .ant-picker-panels {
    .ant-picker-header > button {
      min-width: 2.6em;
    }

    .ant-picker-panel {
      &:nth-child(1) {
        .ant-picker-header-next-btn,
        .ant-picker-header-super-next-btn {
          visibility: visible !important;
        }
      }

      &:nth-child(2) {
        display: none !important;
      }
    }
  }

  // 预设时间
  .ant-picker-dropdown.ant-picker-dropdown .ant-picker-panel-layout {
    display: block;

    .ant-picker-presets {
      display: block;
      min-width: auto;
      max-width: none;

      ul {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 4px;
        height: fit-content;
        border-right: none;
        border-bottom: 1px solid rgba(253, 253, 253, 0.12);

        li {
          margin: 0;
          box-sizing: border-box;
          text-align: center;
        }
      }
    }
  }
}

.ant-picker-cell::before {
  // 禁用单元格动画
  transition: none !important;
}

.ant-picker-dropdown.ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover::before,
.ant-picker-dropdown.ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover::before,
.ant-picker-dropdown.ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover::before,
.ant-picker-dropdown.ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-range-start:not(
    .ant-picker-cell-range-start-single
  ).ant-picker-cell-range-hover-start::before,
.ant-picker-dropdown.ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-range-end:not(
    .ant-picker-cell-range-end-single
  ).ant-picker-cell-range-hover-end::before,
.ant-picker-panel.ant-picker-panel
  > :not(.ant-picker-date-panel)
  .ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start::before,
.ant-picker-panel.ant-picker-panel
  > :not(.ant-picker-date-panel)
  .ant-picker-dropdown
  .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end::before {
  background: rgba(185, 27, 27, 0.3);
}

.ant-picker-dropdown.ant-picker-dropdown {
  .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range {
    &.ant-picker-cell-range-hover-start .ant-picker-cell-inner::after,
    &.ant-picker-cell-range-hover-end .ant-picker-cell-inner::after {
      right: -7px;
      left: -7px;
      border-radius: 4px;
      background: rgba(185, 27, 27, 0.6);
    }
  }
}
